<template>
	<div>
		<h1>登录页面444</h1>
		tel<input type="text" v-model="tel"> <br>
		pwd<input type="text" v-model="pwd"> <br>
		<button @click="login">登录</button>
	</div>
</template>

<script setup>
	import {ref,getCurrentInstance} from "vue"
	import {useRouter} from "vue-router"
	let router=useRouter()
	let {proxy:{axios}}=getCurrentInstance()
	let tel=ref("")
	let pwd=ref("")
	let login=async ()=>{
		let res=await axios.post("/api/login",{tel:tel.value,pwd:pwd.value})
		if(res.data.code==49||res.data.code==4002){
			alert(res.data.info)
		}
		else{
			console.log(res)
			window.localStorage.setItem("islogin","ok")
			router.push("/")
		}
		
	}
</script>

<style>
</style>